Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(main): release json-viewer 3.0.0 #320

Merged
merged 2 commits into from
Apr 25, 2023

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Apr 25, 2023

🤖 I have created a release beep boop

3.0.0 (2023-04-25)

For the detail and migration guide, check out the Migrating from v2 to v3

Main Changes

This major focus on providing the ability to customize and extend data types. We also moved MUI to peerdependency to reflect the correct dependency relationship.

Dependencies

Starting from v3, dependencies from Material-UI are no longer included in the package's dependencies.
Run this to install all the necessary dependencies.

npm install @mui/material @emotion/react @emotion/styled

Browser compatibility

This package was set to support ES5 by default, but it's no longer the case.
Since V3, as this package is using Material-UI, we have adjusted the browser compatibility to match the Material-UI's one.

Use defineDataType instead of createDataType

serialize and deserialize have been added to datatype to support editing feature on any data type.

As the result, createDataType has been renamed to defineDataType and the signature has been changed to accept an object instead of a long list of arguments. For more information, please refer to Defining data types.

- createDataType(
-   (value) => typeof value === 'string' && value.startsWith('https://i.imgur.com'),
-   (props) => <Image height={50} width={50} src={props.value} alt={props.value} />
- )
+ defineDataType({
+   is: (value) => typeof value === 'string' && value.startsWith('https://i.imgur.com'),
+   Component: (props) => <Image height={50} width={50} src={props.value} alt={props.value} />
+ })

Rename displayObjectSize to displaySize

displayObjectSize has been renamed to displaySize to describe the prop's purpose more accurately.

<JsonViewer
-  displayObjectSize={true}
+  displaySize={true}
   value={value}
/>

Now you can provide a function to customize this behavior by returning a boolean based on the value and path.

<JsonViewer
  displaySize={(path, value) => {
    if (Array.isArray(value)) return false
    if (value instanceof Map) return true
    return true
  }}
  value={value}
/>

Expose built-in type for extending

For more information, check Extend Built-in Data Types.

Features

  • dropping createDataType and change the signature of EditorComponent to only accept string
  • expose defineEasyType for easier customization (d727adb)
  • expose built-in type (ed64769)
  • rename displayObjectSize to displaySize (2e5739c)

Bug Fixes

  • fix editing on any datatype (69a359f)
  • improve deprecation message (5e73886)
  • move emotion to peer dependency (5616257)
  • move mui to peerDependencies (9c45b90)
  • remove @emotion/* from jsx importSource (658fddb)
  • type matching should not early return when value is object (0c9ef70)

This PR was generated with Release Please. See documentation.

@netlify
Copy link

netlify bot commented Apr 25, 2023

Deploy Preview for any-viewer ready!

Name Link
🔨 Latest commit 17e8e80
🔍 Latest deploy log https://app.netlify.com/sites/any-viewer/deploys/6447fba6f6c0e30008b64b92
😎 Deploy Preview https://deploy-preview-320--any-viewer.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions bot force-pushed the release-please--branches--main--components--json-viewer branch from 2c8916d to 45a8efb Compare April 25, 2023 15:49
@pionxzh pionxzh merged commit 624e32e into main Apr 25, 2023
@pionxzh pionxzh deleted the release-please--branches--main--components--json-viewer branch April 25, 2023 16:14
@github-actions
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant